In general, an exhaust gas in an internal combustion engine includes air vapor which is produced through combustion reaction of fuel and inhaled air. The air vapor is condensed to become condensed water when the exhaust gas is cooled down in an exhaust pipe. However, an oxygen sensor located at the exhaust pipe may crack when the condensed water is attached to the oxygen sensor which has been heated by a heater.
In JP-2002-48749A, a device is disclosed which estimates a temperature of the exhaust pipe based on an amount of heat received by the exhaust pipe from the exhaust gas and an amount of heat released by the exhaust pipe to the external air. The device activates the heater for the oxygen sensor when the estimated temperature of the exhaust pipe reaches a temperature at which the condensed water is not generated in the exhaust pipe.
When flow speed or density of the exhaust gas changes caused by change of an operation status of the internal combustion engine, an amount of the heat received per a unit time by the exhaust pipe from the exhaust gas also changes and the temperature of the exhaust pipe accordingly changes. However, the device disclosed in JP-2002-48749A does not take the flow speed or the density of the exhaust gas into account in calculating the temperature of the exhaust pipe. The device disclosed in JP-2002-48749A cannot estimate the amount of the heat received by the exhaust pipe with a high degree of accuracy and therefore cannot estimate the temperature of the exhaust pipe with a high degree of accuracy.